<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('temPermissao'))
{
	function temPermissao($permissao,$session_data)
	{
		if (!in_array($session_data["permissao"], $permissao)){ 
			redirect('inicio/sorry');
		}
	}
}
if ( ! function_exists('viewPermissao'))
{
	function viewPermissao($permissao,$session_data)
	{
		if (!in_array($session_data["permissao"], $permissao)){ 
			return false;
		}else{
			return true;
		}
	}
}
//--------------------------------------
if ( ! function_exists('brToUsa'))
{
	function brToUsa($data)
	{
		$data = explode("/", $data);
		$data = $data[2]."-".$data[1]."-".$data[0];
		return $data;
	}
}
//--------------------------------------
if ( ! function_exists('UsaToBr'))
{
	function usaToBr($data)
	{
		if($data != ''){
			$data = explode("-", $data);
			$data1 = $data[2]."/".$data[1]."/".$data[0];
			return $data1;
		}	
	}
}
//--------------------------------------
if ( ! function_exists('brToUsaHora'))
{
	function brToUsaHora($data)
	{
		$data = explode("/", $data);
		$data = $data[2]."-".$data[1]."-".$data[0];
		return $data;
	}
}
//--------------------------------------
if ( ! function_exists('UsaToBrHora'))
{
	function usaToBrHora($data)
	{
		if($data != ''){
			$data = explode(" ", $data);
			$dia = explode("-", $data[0]);
			$hora = $data[1];
			$data1 = $dia[2]."/".$dia[1]."/".$dia[0];
			return $data1;
		}
	}
}
//--------------------------------------
if ( ! function_exists('gerarRelatorio'))
{
	 function gerarRelatorio($pdf){
			//$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
			// Add a page
			// set document information
			$pdf->SetCreator(PDF_CREATOR);
			$pdf->SetAuthor('PROJU');
			$pdf->SetTitle('');
			$pdf->SetSubject('PROJU');
			//$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

			// set default header data
			$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING);

			// set header and footer fonts
			$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
			$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

			// set default monospaced font
			$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

			// set margins
			$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
			$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
			$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

			// set auto page breaks
			$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
			
			// set image scale factor
			$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
			
			
	}
       
}
//--------------------------------------

/* End of file MY_funcoes_auxiliares.php */
/* Location: ./application/helpers/MY_funcoes_auxiliares.php */